
import java.util.Scanner;

public class Test29 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double x = scanner.nextDouble();
        double result;
        if (x >= 0) {
            result = Math.sqrt(x);
        } else {
            result = x * x + 2 * x - 1;
        }
        System.out.printf("f(%.2f) = %.2f\n", x, result);
        scanner.close();
    }
}